home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 2.9 KB | 96 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Programmer: Kent Sandvik
- Date: 12/14/92
- Revision comments are at the end of this file.
- ---
- TSpinCursor is a simple cursor spinning class.
- SpinCursor.h contains the TSpinCursor class definition.
- _________________________________________________________________________________________________________ */
-
- // Declare label for this header file
- #ifndef _SPINCURSOR_
- #define _SPINCURSOR_
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
-
- // TOOLBOX INTERFACES
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
- // _________________________________________________________________________________________________________ //
- // TSpinCursor Class Interface.
-
- class TSpinCursor
- // TSpinCursor is a simple cursor spinning/controlling class, that will bind the CURS and 'acur' resources
- // specified, and animate the cursor to either direction based on the 'acur' list.
- {
- public:
- // ENUMS AND TYPEDEFS
- enum EDirection // our cursor spinning direction
- {
- kBackwards = -1, kForwards = 1
- };
-
- // CONSTRUCTORS AND DESTRUCTORS
- TSpinCursor(short acurID, // the 'acur' resource used
- short SpinDirection = kForwards,// spindirection (default forwards)
- short spinTicks = 60); // amount of ticks between spins (1 second default)
- virtual~ TSpinCursor();
-
- // MAIN INTERFACE
- virtual void Spin(); // start spinning
- virtual void SetSpinDirection(EDirection); // change directions
- // INTERNAL STRUCTS
- struct AnimationCursRec // structure needed to map the 'acur' resource to a data structure
- {
- struct
- {
- unsigned short hasColor:1; // if true uses color cursors
- unsigned short count:15; // # of frames in the cursor list
- } information;
- short frame; // cursor index list of next cursor frame
- CursHandle nCursors[20]; // list of cursor handles
- };
-
- // FIELDS
- protected:CursHandle fCursorHandle; // reference to our cursor handle
- short fCursorID; // ID of the CURS resource
- short fIndex; // index to the animated cursor list
- short fSpinDirection; // 1 = forward, -1 backwards, 2 skip every 2 frames…
- AnimationCursRec * *fCursorList; // list of cursors we will use
- long fTickCounter; // our Tick counter
- short fSpinTicks; // amount of ticks between spins
- OSErr fError; // latest error
- };
-
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 12/14/92 New file
- 2 khs 1/3/93 Cleanup
- */
-